using SheLife.Domain.Entities;

namespace SheLife.Domain.Interfaces.Repositories
{
    public interface INotificationRepository : IRepository<Notification>
    {
        Task<IEnumerable<Notification>> GetByUserIdAsync(Guid userId);
        Task<IEnumerable<Notification>> GetByTypeAsync(string type);
        Task<IEnumerable<Notification>> GetByStatusAsync(string status);
        Task<IEnumerable<Notification>> GetUnreadNotificationsByUserIdAsync(Guid userId);
        Task<int> GetUnreadCountByUserIdAsync(Guid userId);
        Task MarkAsReadAsync(Guid notificationId);
        Task MarkAllAsReadAsync(Guid userId);
    }

    public interface IReminderRepository : IRepository<Reminder>
    {
        Task<IEnumerable<Reminder>> GetByUserIdAsync(Guid userId);
        Task<IEnumerable<Reminder>> GetByTypeAsync(string type);
        Task<IEnumerable<Reminder>> GetByStatusAsync(string status);
        Task<IEnumerable<Reminder>> GetActiveRemindersByUserIdAsync(Guid userId);
        Task<IEnumerable<Reminder>> GetByUserIdAndDateAsync(Guid userId, DateTime date);
        Task MarkAsCompletedAsync(Guid reminderId);
        Task SnoozeReminderAsync(Guid reminderId, DateTime newTime);
    }

    public interface IReminderHistoryRepository : IRepository<ReminderHistory>
    {
        Task<IEnumerable<ReminderHistory>> GetByReminderIdAsync(Guid reminderId);
        Task<IEnumerable<ReminderHistory>> GetByUserIdAsync(Guid userId);
        Task<IEnumerable<ReminderHistory>> GetByUserIdAndDateRangeAsync(Guid userId, DateTime startDate, DateTime endDate);
        Task<ReminderHistory> GetLatestByReminderIdAsync(Guid reminderId);
    }

    public interface IUserNotificationSettingRepository : IRepository<UserNotificationSetting>
    {
        Task<UserNotificationSetting> GetByUserIdAsync(Guid userId);
        Task<UserNotificationSetting> GetByUserIdAndTypeAsync(Guid userId, string type);
        Task UpdateSettingAsync(Guid userId, string type, bool enabled);
    }

    public interface IMessageTemplateRepository : IRepository<MessageTemplate>
    {
        Task<MessageTemplate> GetByCodeAsync(string code);
        Task<MessageTemplate> GetByTypeAsync(string type);
        Task<IEnumerable<MessageTemplate>> GetActiveTemplatesAsync();
    }

    public interface IMessageSendLogRepository : IRepository<MessageSendLog>
    {
        Task<IEnumerable<MessageSendLog>> GetByUserIdAsync(Guid userId);
        Task<IEnumerable<MessageSendLog>> GetByTypeAsync(string type);
        Task<IEnumerable<MessageSendLog>> GetByStatusAsync(string status);
        Task<IEnumerable<MessageSendLog>> GetByDateRangeAsync(DateTime startDate, DateTime endDate);
        Task<MessageSendLog> GetLatestByUserIdAsync(Guid userId);
    }
}